package com.attms.controller;

import com.attms.controller.utils.R;
import com.attms.domain.Absent;
import com.attms.service.IGManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/gmanager")
public class GManagerController {
    @Autowired
    private IGManagerService igManagerService;

    @PostMapping("/{isagree}")
    //总经理处理请假
    public R solveLeave(@PathVariable("isagree")Integer isagree, @RequestBody Absent absent){
        return new R(true, igManagerService.solveLeave(isagree, absent));

    }
    //总经理生成个人请假记录(按照时间，默认为全时间段)
    @GetMapping("/personal")
    public R getPersonalAbsentList(@RequestBody Absent absent){
        return new R (true, igManagerService.getPersonalAbsentList(absent));
    }
    //总经理生成请假记录(按照时间，默认为全时间段)
    @GetMapping("/absentlist")
    public R getAbsentlist() {
        return new R(true, igManagerService.getAbsentList());
    }
    @GetMapping("/absentlistnosolve")
    public R getAbsentlistNosolve() {
        return new R(true, igManagerService.getAbsentListNosolve());
    }

    @GetMapping("/all")
    public R getAllAbsentList(@RequestBody Absent absent){//这个接口不用了
        return new R(true,igManagerService.getAllAbsentList(absent));
    }
}
